package com.hitemole.levelObject;

import java.util.Map;

import com.badlogic.gdx.graphics.g2d.Animation;
import com.badlogic.gdx.math.Rectangle;
import com.badlogic.gdx.math.Vector2;
import com.hitemole.objects.AnimatedInteractableObject;

public class Moles extends AnimatedInteractableObject{
	private static final float HITBOXES = 128;
	
	public static enum MOLE_STATE{EMPTY,SHOW};
	private MOLE_STATE moleState;
	private float timeUntilShow=0;
	private float timeUntilHide=0;
	public Moles(String name, Map<String,Animation> animation, Vector2 position, int collisionType, float xScale, float yScale) {
		super(name, animation, position, collisionType, xScale, yScale);
		// TODO Auto-generated constructor stub
		moleState=MOLE_STATE.SHOW;
		this.collisionShape.width=HITBOXES;
		this.collisionShape.height=HITBOXES;
		this.animationKey="empty";
	}
	
	public void reset(){
		this.timeUntilShow=0;
		this.timeUntilHide=0;
		this.moleState=MOLE_STATE.SHOW;
		this.animationKey="empty";
	}
	
	public Moles(String name, Map<String,Animation> animation, Vector2 position, int collisionType) {
		super(name, animation, position, collisionType,1,1);
		// TODO Auto-generated constructor stub
		moleState=MOLE_STATE.EMPTY;
		this.collisionShape.x=position.x;
		this.collisionShape.x=position.y;
		this.collisionShape.width=HITBOXES;
		this.collisionShape.height=HITBOXES;
	}
	
	@Override
	public void update(float delta) {
		// TODO Auto-generated method stub
		super.update(delta);
//		System.out.println(stateTime);
	}
	
	public MOLE_STATE getState(){
		return moleState;
	}
	public void setState(MOLE_STATE state){
		this.moleState=state;
	}

	public float getStateTime() {
		// TODO Auto-generated method stub
		return stateTime;
	}
	
	public float getTimeUntilShow() {
		return timeUntilShow;
	}

	public void setTimeUntilShow(float timeUntilShow) {
		this.timeUntilShow = timeUntilShow;
	}

	public float getTimeUntilHide() {
		return timeUntilHide;
	}

	public void setTimeUntilHide(float timeUntilHide) {
		this.timeUntilHide = timeUntilHide;
	}
	public Rectangle getRelativeCollisionShape() {
		// TODO Auto-generated method stub
		return new Rectangle(position.x*xScale,position.y*yScale,HITBOXES*xScale,HITBOXES*yScale);
	}
	
	@Override
	public String toString() {
		// TODO Auto-generated method stub
		return name;
	}
}
